﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel;
using System.Collections.Generic;

namespace Testy
{
    [ServiceContract]
    public interface IDataService
    {
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetProjects(AsyncCallback callback, object asyncState);
        Project EndGetProjects(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginAddDeleteRenameProject(string loginToken, string projectID, bool isAddSubproject, string newProjectName,
            AsyncCallback callback, object asyncState);
        bool EndAddDeleteRenameProject(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginLogin(string name, string password, AsyncCallback callback, object asyncState);
        string EndLogin(System.IAsyncResult result);        

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetIssues(string loginToken, AsyncCallback callback, object asyncState);
        List<ProjectIssue> EndGetIssues(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetIssueByID(string loginToken, string issueID, AsyncCallback callback, object asyncState);
        ProjectIssue EndGetIssueByID(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginPostIssue(string loginToken, string projectID,
            string issueName, ProjectIssueType issueType, string firstDetailInfo, AsyncCallback callback, object asyncState);
        bool EndPostIssue(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginUpdateIssueName(string loginToken, string issueID, string newIssueName, 
            AsyncCallback callback, object asyncState);
        bool EndUpdateIssueName(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginUpdateOrAddPersonRoleToIssue(string loginToken, string issueID, 
            string username, PersonIssueRole newRole, AsyncCallback callback, object asyncState);
        bool EndUpdateOrAddPersonRoleToIssue(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginPostIssueDetail(string loginToken, string issueID,
            string detailInfo, AsyncCallback callback, object asyncState);
        bool EndPostIssueDetail(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetUsers(AsyncCallback callback, object asyncState);
        List<User> EndGetUsers(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginAddUser(string login, string password, AsyncCallback callback, object asyncState);
        bool EndAddUser(System.IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginUpdateUserNamePassword(string loginToken, string oldPassword, string newPassword, string newName,
            AsyncCallback callback, object asyncState);
        bool EndUpdateUserNamePassword(System.IAsyncResult result);
    }
}
